package com.yangchao.webflux;

import java.util.ArrayList;
import java.util.List;

public class chat03parallel {
    public static void main(String[] args) {
        List<Student2> students = new ArrayList<>();
        students.add(new Student2("张;三", 18));
        students.add(new Student2("李四", 19));
        students.add(new Student2("王五", 20));
        // 使用flatMap来处理包含分号的学生名字，拆分成多个学生对象
        students.parallelStream().peek(stu-> System.out.println(Thread.currentThread().getName()+ ":"+stu)).forEach(System.out::println);

    }
}
